#ifndef GUIDIALOGUE_HPP_INCLUDED
#define GUIDIALOGUE_HPP_INCLUDED
#include <string>
#include <stdio.h>
#include <cassert>
#include <iostream>
#include "GuiBox.hpp"

class GuiDialog : public GuiBox
{
    public:
        GuiDialog(DialogManager * dialogManager, float textSpeed);
        ~GuiDialog();
        virtual void update();
        virtual void draw(sf::RenderWindow*window);
        void displayCurrentDialog();
        void addDialogChunk(std::string chunk);
        void spaceInput();
        void newLine();

    private:
        sf::Image currentChunkImage;
        sf::Texture currentChunkTexture;
        sf::Sprite currentChunkSprite;

        void setNextCharPosition();
        void nextChunk();
        void reset();

        std::vector<std::string> textBuffer;

        int nextCharX;
        int nextCharY;
        int nextChunkExitValue;

        unsigned int textBufferIndex;

        float textSpeed;
        float charTimeDeltaCounter;
};

#endif
